﻿@model Tasks.UI.Models.Shop.ShopEditModel
@{
    Layout = null;
}
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>购物点编辑</title>
    <link href="@Config.GetCssResourcePath("main.css")" rel="stylesheet" type="text/css" />
    <link href="@Config.GetCssResourcePath("table.css")" rel="stylesheet" type="text/css" />
    <link href="@Url.Content("~/Content/themes/base/jquery.ui.all.css")" rel="stylesheet" type="text/css" />
    <script src="@Url.Content("~/Scripts/jquery-1.5.1.min.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/jquery-ui-1.8.11.min.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/jquery.validate.js")" type="text/javascript"></script>
    <script src="/Scripts/ckeditor/ckeditor_basic.js" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/global.js")" type="text/javascript"></script>
    <script type="text/javascript">
        $().ready(function () {
            // 数字验证
            jQuery.validator.addMethod("isIDCard", function (value, element) {
                return this.optional(element) || /^(0|[1-9][0-9]*)$/.test(value);
            }, "只能是数字并且第一位不为0");

            // 字符验证
            jQuery.validator.addMethod("userName", function (value, element) {
                return this.optional(element) || /^[\u0391-\uFFE5\w]+$/.test(value);
            }, "请输入有效的联系人");
            $("#form").validate({
                showErrors: function (errorMap, errorList) {
                    $.Msg.errorTips("您的表单填写不完整:", 0, errorList);
                },
                rules: {
                    Name: "required",
                    Linkman: "required",
                    Address: "required",
                    LinkmanTel: {
                        required: true
                    }
                },
                messages: {
                    Name: "请输入餐厅名称",
                    Linkman: "请输入联系人",
                    Address: "请输入地址",
                    LinkmanTel: {
                        required: "请输入联系电话"
                    }
                },
                /* 获得焦点时不验证 */
                focusInvalid: false,
                onfocusout: false,
                onkeyup: false
            });

        })

        $(function () {
            initProvince("#ProvinceID");
            initCity("#CityID");
            $("#tabs").tabs();
            var ckConfig = {
                filebrowserImageUploadUrl: '/SystemSetting/CKEditorUploadImage',
                skin: 'office2003',
                toolbar: 'Basic'
            };
            CKEDITOR.replace('Intro', ckConfig);
        })

        function goto(act) {
            $("#act").val(act);
            document.forms[0].submit();
        }
       
    </script>
</head>
<body>
    @using (Html.BeginForm())
    {
        <input id="act" name="act" type="hidden" />  
        <div id="container">
            <div class="navTitle">
                购物点信息
            </div>
            @Html.OutputMessage(Model.Message, Model.MessageType)
            <div class="pageBody">
                <table style="width: 100%; table-layout: fixed;">
                    <tr>
                        <td style="width: 80px;">
                            <strong>名称：</strong>
                        </td>
                        <td style="width: 180px;">
                            @Html.TextBoxFor(t => t.Name)
                        </td>
                        <td style="width: 80px;">
                            <strong>类别:</strong>
                        </td>
                        <td>
                            @Html.DropDownList("ShopType", PageHelper.ShopTypeSelector())
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <strong>所在区域：</strong>
                        </td>
                        <td colspan="3">
                            @Html.DropDownList("ProvinceID", PageHelper.ProvinceSelector(Model.ProvinceID))
                            @Html.DropDownList("CityID", PageHelper.CitySelector(Model.CityID, Model.ProvinceID))
                            @Html.DropDownList("AreaID", PageHelper.AreaSelector(Model.AreaID, Model.CityID))
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <strong>联系人：</strong>
                        </td>
                        <td>
                            @Html.TextBoxFor(t => t.Linkman)
                            <br />
                            <p>
                            </p>
                        </td>
                        <td>
                            <strong>手机：</strong>
                        </td>
                        <td>
                            @Html.TextBoxFor(t => t.LinkmanMobile)
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <strong>电话：</strong>
                        </td>
                        <td>@Html.TextBoxFor(t => t.LinkmanTel)
                        </td>
                        <td>
                            <strong>传真</strong>
                        </td>
                        <td>@Html.TextBoxFor(t => t.Fax)
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <strong>人头费：</strong>
                        </td>
                        <td colspan="3">
                            @Html.TextBoxFor(t => t.UnitPrice)<span>元/人</span>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <strong>提 成：</strong>
                        </td>
                        <td colspan="3">@Html.TextBoxFor(t => t.CommissionRate)
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <strong>地 址：</strong>
                        </td>
                        <td colspan="3">@Html.TextBoxFor(t => t.Address)
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <strong>付款方式：</strong>
                        </td>
                        <td colspan="3">
                            @Html.DropDownList("PaymentMode", PageHelper.EnterprisePaymentModeSelector(Model.PaymentMode))
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <strong>备注：</strong>
                        </td>
                        <td colspan="3">
                            @Html.TextAreaFor(t => t.Remark, new { style = "width:100%;height:60px;" })
                        </td>
                    </tr>
                </table>
            </div>
            <div style="margin-left: 80px;" class="BottomBtn">
                <button class="big blue" type="button" onclick="goto('save')">
                    <span>保存</span></button>
                <button class="big blue" type="button" onclick="goto('apply')">
                    <span>应用</span></button>
                <button class="big blue" type="button" onclick="closeTab()">
                    <span>取消</span></button></div>
        </div>
    }
</body>
</html>
